Component({
	properties: {
		// 这里定义了innerText属性，属性值可以在组件使用时指定
		innerText: {
			type: String,
			value: 'default value',
		}
	},
	data: {
		// 这里是一些组件内部数据
		timeString: ''
	},
	attached: function() {


		this.customMethod();
	},
	methods: {
		// 这里是一个自定义方法
		customMethod: function() {
			var _self = this;
			var minute, second;
			var count = parseInt(this.properties.innerText);
			this.timer = setInterval(function() {

				count--;
				if (count > 0) {
					minute = parseInt(count / 60);
					second = count % 60;
					if (second < 10) {
						second = '0' + second;
					}

				} else {
					minute = 0;
					second = 0;
				}
				_self.setData({
					minute: minute,
					second: second
				})
				_self.setData({
					timeString: minute + ':' + second
				})
			}, 1000)
		}
	}
})